package data

import (
	"core/class"
	"core/corestruct"
	"core/datetime"
	"ht/selfreg"
	"reflect"
)

type HtUserDto struct {
	Id int64 `json:"id,string"                         gorm:"column:id;primaryKey;comment:主键;autoIncrement:false;"`

	Ename    string                 `json:"ename"        validate:"max=50"   gorm:"column:ename;size:50;DEFAULT:'';not null;comment:账号;"`
	Name     string                 `json:"name"         validate:"required,max=50"gorm:"column:name;size:50;DEFAULT:'';not null;comment:姓名;"`
	EditPwd  bool                   `json:"editPwd"                          gorm:"column:edit_pwd;not null;comment:修改密码;"`
	Pwd      string                 `json:"-"          validate:"max=50"   gorm:"-;comment:密码;"`
	Sex      string                 `json:"sex"          validate:"max=100"  gorm:"column:sex;size:100;DEFAULT:'';not null;comment:性别;memo:男、女;"`
	Birthday datetime.MyTime        `json:"birthday"                         gorm:"column:birthday;not null;comment:出生日期;"`
	Zw       string                 `json:"zw"           validate:"max=50"   gorm:"column:zw;size:50;DEFAULT:'';not null;comment:职务;"`
	Email    string                 `json:"email"        validate:"max=100"  gorm:"column:email;size:100;DEFAULT:'';not null;comment:邮箱;"`
	Mobile   string                 `json:"mobile"       validate:"max=50"   gorm:"column:mobile;size:50;DEFAULT:'';not null;comment:手机号;"`
	Address  string                 `json:"address"      validate:"max=100"  gorm:"column:address;size:100;DEFAULT:'';not null;comment:住址;"`
	Memo     string                 `json:"memo"                             gorm:"column:memo;DEFAULT:'';not null;comment:备注;"`
	Url      string                 `json:"url"                              gorm:"column:url;DEFAULT:'';not null;comment:照片;"`
	CrtDt    datetime.MyTime        `json:"crtDt"                            gorm:"column:crt_dt;not null;comment:创建日期;"`
	CrtUid   int64                  `json:"crtUid,string"                    gorm:"column:crt_uid;DEFAULT:0;not null;comment:创建人编号;"`
	CrtDid   int64                  `json:"crtDid,string"                    gorm:"column:crt_did;DEFAULT:0;not null;comment:所属机构;"`
	EdtDt    datetime.MyTime        `json:"edtDt"                            gorm:"column:edt_dt;not null;comment:修改日期;"`
	CrtUname string                 `json:"crtUname"                         gorm:"column:crt_uname;DEFAULT:'';not null;comment:创建人编号;"`
	CrtDname string                 `json:"crtDname"                         gorm:"column:crt_dname;DEFAULT:'';not null;comment:所属机构;"`
	State    string                 `json:"state"        validate:"max=100"  gorm:"column:state;size:100;DEFAULT:'';not null;comment:状态;memo:启用、停用;"`
	RoleList []corestruct.IdNameDto `json:"roleList"                         gorm:"-"`
}

func init() {
	var mcls = &HtUserDto{}
	var m = &class.MyClass{
		Name:     "用户Dto",
		Ename:    "",
		FullName: "",
		Memo:     "",
		Fileds:   nil,
		PrjName:  "",
		Type:     reflect.TypeOf(mcls),
	}
	selfreg.AddDto(m)
}
